@layout("/common/_container.html"){
<div style="margin: 15px;">
    <div class="layui-form layui-form-pane" lay-filter="userViewForm">
        <input type="hidden" name="id" value="${user.id}"/>
        <div class="layui-form-item">
            <label class="layui-form-label">账号</label>
            <div class="layui-input-block">
                <input type="text" name="username" autocomplete="off" class="layui-input" value="${user.username}"
                       readonly/>
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">姓名</label>
            <div class="layui-input-block">
                <input type="text" name="realName" autocomplete="off" class="layui-input" value="${user.realName}" readonly/>
            </div>
        </div>

        <div class="layui-form-item" pane>
            <label class="layui-form-label">性别</label>
            <div class="layui-input-block">
                <input type="radio" name="sex" value="1" title="男" ${user.sex==1?"checked":""}/>
                <input type="radio" name="sex" value="2" title="女" ${user.sex==2?"checked":""}/>
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">生日</label>
            <div class="layui-input-block">
                <input type="text" id="birthday" name="birthday" autocomplete="off" class="layui-input"
                       value="${user.birthday,dateFormat='yyyy-MM-dd'}" readonly/>
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">电子邮件</label>
            <div class="layui-input-block">
                <input type="text" name="email" autocomplete="off" class="layui-input" value="${user.email}" readonly/>
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">手机号</label>
            <div class="layui-input-block">
                <input type="text" name="mobile" autocomplete="off" class="layui-input" value="${user.mobile}" readonly/>
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">部门</label>
            <div class="layui-input-block">
                <a href="javascript:void(0);" class="layui-btn">${user.departmentName!"未设置"}</a>
            </div>
        </div>

        <div class="layui-form-item" pane>
            <label class="layui-form-label">状态</label>
            <div class="layui-input-block">
                <input type="radio" name="status" value="1" title="启用" ${user.status==1?"checked":""}/>
                <input type="radio" name="status" value="0" title="停用" ${user.status==0?"checked":""}/>
            </div>
        </div>

        <div class="layui-form-item" pane>
            <label class="layui-form-label">角色</label>
            <div class="layui-input-block">
                @for(role in roleList){
                @if(array.contain(roles,role.id+"")){
                <input type="checkbox" name="roleIds" value="${role.id}" title="${role.roleName}" checked readonly/>
                @}
                @}
            </div>
        </div>

    </div>
</div>

<script>
    $(function () {
        var form = layui.form;
        form.render(null, "userViewForm");
    });
</script>
@}
